package com.bigknow.appstore.proxy.log;

import com.bigknow.appstore.proxy.entity.ProxyLog;
import com.bigknow.appstore.proxy.enumerate.ErrorType;
import com.bigknow.appstore.proxy.enumerate.LogLevel;
import com.bigknow.appstore.proxy.exceptions.ProxyError;
import com.bigknow.appstore.proxy.vo.RequestVo;

/**
 * 审计输出接口
 * Created by chaos on 2016/5/26.
 */
public interface ILogWriter {

    boolean isDebug();

    boolean isInfo();

    boolean isError();

    void setLevel(LogLevel logLevel);

    LogLevel getLevel();

    void writeLog(ProxyLog log);

    ProxyLog createBasicLogObject(RequestVo requestVo);

    ProxyLog createErrorLogObject(RequestVo requestVo, ErrorType errorType, String errorMessage);

    ProxyLog createSuccessLogObject(RequestVo requestVo, long size);

    ProxyLog createErrorLogObject(ProxyError error);

    ProxyLog createErrorLogObject(String clientAddress, ErrorType errorType, String errorMessage);
}
